//
//  MailInfo.m
//  EpointFrame5
//
//  Created by Pill Gong on 14-2-7.
//  Copyright (c) 2014年 Epoint. All rights reserved.
//

#import "MailInfo.h"
#import "EpointStringUtil.h"
#import "SingleFile.h"

@implementation MailInfo

- (void)setContentWithArray:(GDataXMLElement *)arr {
    GDataXMLElement *MAILGUID = [[arr elementsForName:@"MAILGUID"] objectAtIndex:0];
    self.MAILGUID = [MAILGUID stringValue];
    
    GDataXMLElement *FROMDISPNAME = [[arr elementsForName:@"FROMDISPNAME"] objectAtIndex:0];
    self.FROMDISPNAME = [FROMDISPNAME stringValue];
    
    GDataXMLElement *FromUserGuid = [[arr elementsForName:@"FromUserGuid"] objectAtIndex:0];
    self.FromUserGuid = [FromUserGuid stringValue];
    
    GDataXMLElement *Subject = [[arr elementsForName:@"Subject"] objectAtIndex:0];
    self.Subject = [Subject stringValue];
    
    GDataXMLElement *SENDTIME = [[arr elementsForName:@"SENDTIME"] objectAtIndex:0];
    self.SENDTIME = [SENDTIME stringValue];
    
    GDataXMLElement *isRead = [[arr elementsForName:@"haveread"] objectAtIndex:0];
    self.isRead = [isRead stringValue];
    
    GDataXMLElement *ToUserDispNameList = [[arr elementsForName:@"ToUserDispNameList"] objectAtIndex:0];
    self.ToUserDispNameList = [ToUserDispNameList stringValue];
    
    GDataXMLElement *ChaoSongUserDispNameList = [[arr elementsForName:@"ChaoSongUserDispNameList"] objectAtIndex:0];
    self.ChaoSongUserDispNameList = [ChaoSongUserDispNameList stringValue];
    
    GDataXMLElement *MailContent = [[arr elementsForName:@"MailContent"] objectAtIndex:0];
    self.MailContent = [MailContent stringValue];
    
    GDataXMLElement *HasAttach = [[arr elementsForName:@"HasAttach"] objectAtIndex:0];
    self.HasAttach = [HasAttach stringValue];
    
    GDataXMLElement *IsAllSign = [[arr elementsForName:@"IsAllSign"] objectAtIndex:0];
    self.IsAllSign = [IsAllSign stringValue];

    GDataXMLElement *SecretUserDispNameList = [[arr elementsForName:@"SecretUserDispNameList"] objectAtIndex:0];
    self.SecretUserDispNameList = [SecretUserDispNameList stringValue];
    
    GDataXMLElement *ToUserGuidList = [[arr elementsForName:@"ToUserGuidList"] objectAtIndex:0];
    self.ToUserGuidList = [ToUserGuidList stringValue];
    
    GDataXMLElement *SecretUserGuidList = [[arr elementsForName:@"SecretUserGuidList"] objectAtIndex:0];
    self.SecretUserGuidList = [SecretUserGuidList stringValue];

    GDataXMLElement *ChaoSongUserGuidList = [[arr elementsForName:@"ChaoSongUserGuidList"] objectAtIndex:0];
    self.ChaoSongUserGuidList = [ChaoSongUserGuidList stringValue];
    
    GDataXMLElement *IsShowShouHui = [[arr elementsForName:@"IsShowShouHui"] objectAtIndex:0];
    self.IsShowShouHui = [IsShowShouHui stringValue];
    
    GDataXMLElement *NeedTaskMonitor = [[arr elementsForName:@"NeedTaskMonitor"] objectAtIndex:0];
    self.NeedTaskMonitor = [NeedTaskMonitor stringValue];
    
    GDataXMLElement *ATTACHList = [[arr elementsForName:@"ATTACHList"] objectAtIndex:0];
    if (ATTACHList) {
        NSArray *singleFileArr = [ATTACHList elementsForName:@"SingleFile"];
        self.attachList = [NSMutableArray arrayWithCapacity:singleFileArr.count];
        for (GDataXMLElement *arr2 in singleFileArr) {
            SingleFile *singleFile = [[SingleFile alloc] init];
            [singleFile setContentWithArray:arr2];
            [_attachList addObject:singleFile];
        }
    }
}

@end
